<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // var k = 7;
        // console.log(k);
        /*****/
        // 1\let不允许重复声明

        console.log(k);
        // var k = 20; //undefined
        let k = 2;//Cannot access 'k' before initialization
        let k = 2;//Identifier 'k' has already been declared
        // console.log(k);

        // 2\let创建局部变量（块级）
        // for (var i = 0; i < 5; i++) {
        //     console.log(i);//0 1 2 3 4
        // }
        // console.log("i=",i);//5
        // for (let i = 0; i < 5; i++) {
        //     console.log(i);//0 1 2 3 4
        // }
        // console.log("i=",i);//i is not defined



// 3\  
        // function show(args) {
        //     var args = "999";
        //     console.log(args);
        // }
        // show("888")

        // function show(args) {
        //     let args = "999";
        //     console.log(args);
        // }
        // show("888")

        function show(args) {
            {let args = "999";
            console.log(args);}
        }
        show("888")

        const a=1
        a=2
        console.log(a)




    </script>
</body>

</html>